<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2018/8/6
 * Time: 14:45
 */

namespace app\api\model;


use think\Model;

class ClassroomUser extends Model
{
    /**
     * 判断用户是否购买了该课程
     * @param $classroom_id  课程ID
     * @param $user_id   用户ID
     * @return array|false|\PDOStatement|string|Model
     */
    public function ifBuy($classroom_id, $user_id){
        $res = $this->where('classroom_id', $classroom_id)->where('user_id', $user_id)->find();
        return $res;
    }
}